//
//  UIScrollView+SFNavigationBarManager.m
//  Pods-SFNavigationBarManager_Example
//
//  Created by shen on 2021/11/17.
//

#import "UIScrollView+SFNavigationBarManager.h"
#import <objc/runtime.h>
#import "SFSwizzle.h"

@implementation UIScrollView (SFNavigationBarManager)

#ifdef __IPHONE_11_0
- (UIScrollViewContentInsetAdjustmentBehavior)sf_originalContentInsetAdjustmentBehavior {
    return [objc_getAssociatedObject(self, _cmd) integerValue];
}

- (void)setSf_originalContentInsetAdjustmentBehavior:(UIScrollViewContentInsetAdjustmentBehavior)contentInsetAdjustmentBehavior {
    objc_setAssociatedObject(self, @selector(sf_originalContentInsetAdjustmentBehavior), @(contentInsetAdjustmentBehavior), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (BOOL)sf_shouldRestoreContentInsetAdjustmentBehavior {
    return [objc_getAssociatedObject(self, _cmd) boolValue];
}

- (void)setSf_shouldRestoreContentInsetAdjustmentBehavior:(BOOL)isShould {
    objc_setAssociatedObject(self, @selector(sf_shouldRestoreContentInsetAdjustmentBehavior), @(isShould), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
#endif

@end
